public class Work1 {
    public static void main(String[] args) {
        //编写程序数一下 1到 100 的所有整数中出现多少个数字9
        int i = 1;
        int count = 0;
        for (; i <= 100; i++) {
            int tmp = i;
            while (tmp > 0) {
                if (tmp % 10 == 9) {
                    count++;
                }
                tmp /= 10;
            }
        }
        System.out.println(count);
    }
}
